<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateUserroleTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <p:layout fullPage="true">
                <p:layoutUnit position="north" size="90">
                    <h:panelGrid columns="3">
                        <p:graphicImage value="/resources/ikey.png" /> 
                        <table class="logintbl">
                            <tr>
                                <td><strong>Logged as:</strong>&nbsp;#{shiroLoginBean.username}&nbsp;|</td>
                                <td><h:form><h:commandLink action="#{logout.submit}" value="logout"/></h:form></td>
                            </tr>
                        </table>
                    </h:panelGrid>
                </p:layoutUnit>
                <p:layoutUnit position="west" size="200">
                    <p:panel header="Navigate">
                        <table border="0" class="teble">
                            <tr><td><p:commandLink styleClass="ui-icon ui-icon-folder-collapsed" action="/uploads/List"/></td><td><h:link outcome="/uploads/List" value="Uploads"/></td></tr>
                            <tr><td><p:commandLink styleClass="ui-icon ui-icon-info" action="/userrole/List"/></td><td><h:link outcome="/faces/configs.xhtml" value="Server Status"/></td></tr>
                            <tr><td><p:commandLink styleClass="ui-icon ui-icon-person" action="/users/List"/></td><td><h:link outcome="/users/List" value="System Users"/></td></tr>
                        </table>
                    </p:panel>
                </p:layoutUnit>
                <p:layoutUnit position="center">
                    <p:panel header="New User Role">
                        <h:panelGroup id="messagePanel" layout="block">
                            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                        </h:panelGroup>
                        <h:form>
                            <h:panelGrid columns="2">
                                <h:outputLabel value="#{bundle.CreateUserroleLabel_roleid}" for="roleid" />
                                <h:inputText id="roleid" value="#{userroleController.selected.roleid}" title="#{bundle.CreateUserroleTitle_roleid}" required="true" requiredMessage="#{bundle.CreateUserroleRequiredMessage_roleid}"/>
                                <h:outputLabel value="#{bundle.CreateUserroleLabel_rolename}" for="rolename" />
                                <h:inputText id="rolename" value="#{userroleController.selected.rolename}" title="#{bundle.CreateUserroleTitle_rolename}" />
                            </h:panelGrid>
                            <table>
                                <tr><td><h:commandLink id="cq" action="#{userroleController.create}" value="#{bundle.CreateUserroleSaveLink}" />&nbsp;|</td>
                                    <td><h:commandLink id="cr" action="#{userroleController.prepareList}" value="#{bundle.CreateUserroleShowAllLink}" immediate="true"/>&nbsp;|</td>
                                    <td><h:link id="cs" outcome="/index" value="#{bundle.CreateUserroleIndexLink}"/></td>
                                </tr>
                            </table>
                            <p:tooltip for="cq" value="Save Details"/>
                            <p:tooltip for="cr" value="Show all items"/>
                            <p:tooltip for="cs" value="Home"/>
                        </h:form>
                    </p:panel>
                </p:layoutUnit>
            </p:layout>
        </ui:define>
    </ui:composition>
</html>
